Code Listing 1. Universum Bean Primary Key Interface

package org.article.entitybean;
import java.sql.*;
import org.article.util.UniversumData;
import java.util.*;


/**
 * Universal EJB primary key class that defines an interface that each concrete
 * primary key class must implement.
 * @version: 1.0
 * @author: Andrei Povodyrev
 */
public interface UniversumPK 	extends java.io.Serializable{
   
	public int hashCode(); //required by EJB specs   
	public String toString(); //required by EJB specs
   
	/**
	 * Implement this to determine primary key equality with another of the same type, required by EJB specs
	 * @param   obj  another UniversumPK
	 * @return     true if the primary keys are the same
	 */
	 
	public boolean equals(Object obj);   

	public UniversumPK insert(UniversumData beanAttributes, Connection con)
   		throws SQLException;
   
	/**
	 * Called to delete the row represented by this primary key
	 * @exception   SQLException  
	 */
	public void delete(Connection con) throws SQLException;

		/**
	 * Called to update the row represented by this primary key
	 * @exception   SQLException  
	 */
	public  void update(UniversumData beanAttributes, Connection con)
   		throws SQLException;
   		
		/**
	 * Called to select the row represented by this primary key
	 * @return UniversumData
	 * @exception   SQLException  
	 */   		
	public UniversumData select(Connection con) throws SQLException;
   	   
	/**
	 * Called to test for existance of the record represented by this primary key
	 * @return     true if the record exists
	 * @exception   SQLException  
	 */
	public boolean exists(Connection con) throws SQLException;     

	/**
	 * Finds records using a SQL where clause
	 * @param   where  the SQL where clause
	 * @return     an enumeration of records
	 * @exception   SQLException  
	 */
	
	public Collection findBySQLWhere(String where, Connection con) throws SQLException;
	
	 /** Validates entry data which keys must match those specified by the concrete primary key class
	 * @return     true if entry data valid
	 **/

  public boolean validate(UniversumData attributes)throws SQLException;  
 		
	}

